package com.aabte.permissionframeworklearn.permission.mapper;

import com.aabte.permissionframeworklearn.permission.model.SysUserRole;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysUserRoleMapper {
    int deleteByPrimaryKey(Long id);

    int insert(SysUserRole record);

    int insertSelective(SysUserRole record);

    SysUserRole selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysUserRole record);

    int updateByPrimaryKey(SysUserRole record);

    List<Long> getRoleIdListByUserId(@Param("userId") Long userId);

    List<Long> getUserIdListByRoleId(@Param("roleId") Long roleId);

    void deleteByRoleId(@Param("roleId") Long roleId);

    void batchInsert(@Param("userRoles") List<SysUserRole> sysUserRoles);

    int countByRoleId(@Param("roleId") Long id);

    List<Long> getUserIdListByRoleIdIn(@Param("roleIds") List<Long> roleIds);
}